/*
Bullet Continuous Collision Detection and Physics Library
Copyright (c) 2003-2007 Erwin Coumans  http://continuousphysics.com/Bullet/

This software is provided 'as-is', without any express or implied warranty.
In no event will the authors be held liable for any damages arising from the use of this software.
Permission is granted to anyone to use this software for any purpose, 
including commercial applications, and to alter it and redistribute it freely, 
subject to the following restrictions:

1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/

/*
Peter James:
Sections of this project have used assets or information from web and other sources,
We claim no ownership of these excerpts and are only using them for educational purposes.
A list of asset and information sources can be found here:


The button art, game over state were created by Genesis Smith

Through out this project I have used parts of code taken from the Bullet Physics Wiki website,
http://bulletphysics.org/mediawiki-1.5.8/index.php/Main_Page

The image for the splash state background was found:
http://iranpoliticsclub.net/history/artemisia/index.htm


Unfortunately we were unable to fully implement the following features in time:
HUD buttons in playstate
more accurate lighting



*/


#include <iostream> 
#include "btBulletCollisionCommon.h"
#include "btBulletDynamicsCommon.h"

#include "Screen.h"
#include "Game.h"
#include "LoadScreen.h"
#include "TextureManager.h"

#include "SoundManager.h"
#include "SplashState.h"
#include "MeshManager.h"

#include <stdio.h>




#undef main


int main(int argc, char** argv)
{

	TheScreen::Instance()->CreateWindow( 800, 600);
	
	TheLoadScreen::Instance();
	
	TheTextureManager::Instance()->Load("TexturePaths.txt");
	TheSoundManager::Instance()->Load("SoundEffectPaths.txt", "MusicTrackPaths.txt");

	TheMeshManager::Instance()->Load("MeshPaths.txt");

	Game* game = TheGame::Instance();
	btDefaultCollisionConfiguration* collisionConfig = new btDefaultCollisionConfiguration;
	game->BTSetDefaultCollisionConfig(collisionConfig);
	game->BTSetCollisionDispatcher(new btCollisionDispatcher(collisionConfig));
	game->BTSetBroadPhase(new btDbvtBroadphase);
	game->BTSetConstraintSolver(new btSequentialImpulseConstraintSolver);
	game->BTCreateDynamicsWorld();

	TheGame::Instance()->SetGameState(TheSplashState::Instance());
	
	TheGame::Instance()->Start();

	std::cin.get();
	return 0;
}
